home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9709 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Where is "graph.h" in UNIX???
  5. Date: 12 Mar 1996 13:36:03 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4i4qo3INNb6r@keats.ugrad.cs.ubc.ca>
  8. References: <KENNYC.96Mar12121852@happy.s3.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <KENNYC.96Mar12121852@happy.s3.com>,
  12. Kenny Chen  S3 Inc (408)980-5401 x3425 <kennyc@happy.s3.com> wrote:
  13.  >I am trying to draw some simple curves using C program. Is it possible
  14.  >that I can do it in the UNIX system?
  15.  
  16. You can do it, but you have to use special libraries. There are many graphics
  17. libraries in the UNIX world, some of which are standardized and portable, more
  18. less. Others are specific to a particular workstation, just like Turbo C's
  19. methods are particular to, well, Turbo C.
  20.  
  21. One popular graphics system is the client/server XWindow system, which is
  22. driven by a portable client C library called Xlib. It, along with its
  23. associated tools like Xt (the X toolkit) is found just about everywhere there
  24. is UNIX with a graphical display. Other libraries such as OpenGL are not as
  25. universal.
  26.  
  27. Get some Xlib programming manuals, and come back in six months when your simple
  28. curves program functions!  :) Or find some freeware, easy-to-use graphics
  29. library which can be used over X. One such library is VOGL---which supports a
  30. small subset of GL.
  31.  
  32. There is an X newsgroup, by the way, where X questions are appropriate.
  33.  
  34. Another possibility is to generate PostScript output via printf() and friends.
  35. This is the closest method that is even remotely on-topic for this newsgroup,
  36. barring a discussion of the actual PostScript itself.
  37.  
  38. You can view a generated PostScript file via a viewer such as GhostView which
  39. uses the GhostScript back end.
  40.  
  41. This is probably your best best. Why? Because PostScript has a rich drawing
  42. model, is easy to work with (basically you just print out a text file
  43. PostScript program), and many high-quality printers will accept your program
  44. directly. The output is also compact, resolution independent and easy to
  45. encapsulate as EPSF and incorporate into existing documents (LaTeX, Framemaker,
  46. etc). Furthermore, you can draw text in PostScript in all kinds of fonts, at
  47. any rotation or scale, and even embed bitmapped images.
  48.  
  49. Or I have to use the Turbo C in
  50.  >PC?
  51.  >And where can I find the "conio.h" and "graph.h" ?
  52.  
  53. Nowhere. These are particular to the PC/MSDOS C environments.
  54. -- 
  55.  
  56.